﻿<!--
Project: ClipFlair (http://ClipFlair.codeplex.com)
Filename: MediaPlayerWindow.xaml
Version: 20150204
-->

<clipflair:BaseWindow x:Class="ClipFlair.Windows.MediaPlayerWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:clipflair="clr-namespace:ClipFlair.Windows;assembly=ClipFlair.Windows.Base"
    xmlns:media="clr-namespace:ClipFlair.MediaPlayer;assembly=MediaPlayer"
    xmlns:options="clr-namespace:ClipFlair.Windows.Options"
    mc:Ignorable="d"
    d:DesignHeight="100" d:DesignWidth="690"
    >

  <clipflair:BaseWindow.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/ClipFlair.Windows.Base;component/Themes/Generic.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </clipflair:BaseWindow.Resources>
  
  <!--<clipflair:BaseWindow.FrontContent>-->
  
  <!-- Background property doesn't seem to change the MediaPlayer background, always shows Black (neither x:Null, nor Transparent works) -->

  <media:MediaPlayer Name="player" 
     HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                    
     EnableCachedComposition="True"
                                     
     Source="{Binding Source, Mode=TwoWay}"
                     
     Time="{Binding Time, Mode=TwoWay}"
     Captions1="{Binding Captions, Mode=TwoWay}"
                     
     VolumeLevel="{Binding Volume, Mode=TwoWay}"
     Balance="{Binding Balance, Mode=TwoWay}"
                      
     AutoPlay="{Binding AutoPlay, Mode=TwoWay}"
     ContinuousPlay="{Binding Looping, Mode=TwoWay}"
                     
     VideoVisible="{Binding VideoVisible, Mode=TwoWay}"
     IsControlStripVisible="{Binding ControllerVisible, Mode=TwoWay}"
     CaptionsVisible="{Binding CaptionsVisible, Mode=TwoWay}"
                     
     AllowSpaceBarToggle="True"
     SeekWhileScrubbing="True"
                     
     RewindButtonVisible="True"
     FastForwardButtonVisible="True"
     PlaylistButtonVisible="False"
     BitrateVisible="False"

     ReplayButtonVisible="True"
     ReplayOffset="{Binding ReplayOffset, Mode=TwoWay}"

     SlowMotionButtonVisible="False"
     FullScreenButtonVisible="False"
                                         
     MediaOpened="player_MediaOpened"
     TimelineMarkerReached="player_TimelineMarkerReached"
     TimelineMarkerLeft="player_TimelineMarkerLeft"
     >
    <!-- EnableSync="True" (TODO: read SMF documentation on PiP) -->
  </media:MediaPlayer> <!-- not using {x:null} nor Transparent for Background, with the later some videos were blending with the background color of the MediaPlayerWindow -->

  <!--</clipflair:BaseWindow.FrontContent>-->

  <clipflair:BaseWindow.PropertyItems>

    <options:MediaPlayerOptions x:Name="mediaPlayerOptions" DataContext="{Binding}" /> <!-- uses same DataContext (the View) -->
    
    <StackPanel Orientation="Vertical">

      <TextBlock TextDecorations="Underline">Troubleshooting</TextBlock>
      <TextBlock/>

      <StackPanel Orientation="Horizontal">
        <CheckBox Name="cbBitrateVisible" IsChecked="{Binding Path=BitrateVisible, ElementName=player, Mode=TwoWay}" />
        <Label Style="{StaticResource PropertyLabelStyle}" Content="Bitrate visible" Target="{Binding ElementName=cbBitrateVisible}"/>
      </StackPanel>

      <StackPanel Orientation="Horizontal">
        <CheckBox Name="cbGraphVisible" IsChecked="{Binding Path=GraphVisible, ElementName=player, Mode=TwoWay}" />
        <Label Style="{StaticResource PropertyLabelStyle}" Content="Graph visible" Target="{Binding ElementName=cbGraphVisible}"/>
      </StackPanel>

      <StackPanel Orientation="Horizontal">
        <CheckBox Name="cbConsoleVisible" IsChecked="{Binding Path=ConsoleVisible, ElementName=player, Mode=TwoWay}" />
        <Label Style="{StaticResource PropertyLabelStyle}" Content="Console visible" Target="{Binding ElementName=cbConsoleVisible}"/>
      </StackPanel>

    </StackPanel>

  </clipflair:BaseWindow.PropertyItems>

</clipflair:BaseWindow>
